import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home.vue'

Vue.use(VueRouter)

const routes = [

  {
    path: '/',
    name: 'home',
    component: home,
    redirect: '/homePage',
    children: [
      {
        path: '/homePage',
        name: 'homePage',
        component: () => import('../views/homePage.vue'),
        meta: { title: '网站首页' }
      },
      {
        path: '/general',
        name: 'general',
        component: () => import('../views/general.vue'),
        meta: { title: '林区概况' },
        redirect: '/generalOne',
        children: [
          {
            path: '/generalOne',
            name: 'generalOne',
            component: () => import('../views/situation/general.vue'),
            meta: { title: '林区概况' }
          },
          {
            path: '/forestAudio',
            name: 'forestAudio',
            component: () => import('../views/situation/forestAudio.vue'),
            meta: { title: '林区影音' }
          },
          {
            path: '/forestInformation',
            name: 'forestInformation',
            component: () => import('../views/situation/forestInformation.vue'),
            meta: { title: '林区资讯' }
          },
          {
            path: '/lqxxInfo',
            name: 'lqxxInfo',
            component: () => import('../views/situation/lqxxInfo.vue'),
            meta: { title: '林区信息' }
          },
          {
            path: '/jcfw',
            name: 'jcfw',
            component: () => import('../views/situation/jcfw.vue'),
            meta: { title: '基础服务' }
          }
        ]
      },
      {
        path: '/lqxx',
        name: 'lqxx',
        component: () => import('../views/situation/lqxx.vue'),
        meta: { title: '林区资讯' }
      },
      {
        path: '/district',
        name: 'district',
        component: () => import('../views/district.vue'),
        meta: { title: '醉美林区' },
        redirect: '/landmarkspot',
        children: [
          {
            path: '/landmarkspot',
            name: 'landmarkspot',
            component: () => import('../views/zumeidistrict/landmarkspot.vue'),
            meta: { title: '标志景点' }
          },
          {
            path: '/experiencetheme',
            name: 'experiencetheme',
            component: () => import('../views/zumeidistrict/experiencetheme.vue'),
            meta: { title: '体验主题' }
          },
          {
            path: '/culturalforestarea',
            name: 'culturalforestarea',
            component: () => import('../views/zumeidistrict/culturalforestarea.vue'),
            meta: { title: '文化林区' }
          },
          {
            path: '/ecologicalforestarea',
            name: 'ecologicalforestarea',
            component: () => import('../views/zumeidistrict/ecologicalforestarea.vue'),
            meta: { title: '生态林区' }
          }
        ]
      },
      {
        path: '/eventGala',
        name: 'eventGala',
        component: () => import('../views/eventGala.vue'),
        meta: { title: '活动盛典' }
      },
      {
        path: '/notice',
        name: 'notice',
        component: () => import('../views/notice.vue'),
        meta: { title: '通知公告' }
      },

      {
        path: '/ticketReservation',
        name: 'ticketReservation',
        component: () => import('../views/ticketReservation.vue'),
        meta: { title: '票务预订' }
      },
      {
        path: '/jdxq',
        name: 'jdxq',
        component: () => import('../views/jdxq.vue'),
        meta: { title: '景点详情' }
      },
      {
        path: '/gywm',
        name: 'gywm',
        component: () => import('../views/gywm.vue'),
        meta: { title: '关于我们' }
      },
      {
        path: '/jiaot',
        name: 'jiaot',
        component: () => import('../views/jiaot.vue'),
        meta: { title: '交通' }
      }

    ]
  }

]

const router = new VueRouter({
  routes,
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})

export default router
